# hash:sha256:932fb724b34e65e6aa501e425ded9600b96d03af1d62fcf240f8a1e0b78d2db8
FROM registry.codeocean.com/codeocean/miniconda3:4.7.10-python3.7-ubuntu18.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential=12.4ubuntu1 \
        cmake=3.10.2-1ubuntu2.18.04.1 \
        dvipng=1.15-1 \
        g++=4:7.4.0-1ubuntu2.3 \
        gcc=4:7.4.0-1ubuntu2.3 \
        gdal-bin=2.2.3+dfsg-2 \
        gfortran=4:7.4.0-1ubuntu2.3 \
        libgdal-dev=2.2.3+dfsg-2 \
        libgit2-dev=0.26.0+dfsg.1-1.1ubuntu0.2 \
        libpython3-dev=3.6.7-1~18.04 \
        libssl-dev=1.1.1-1ubuntu2.1~18.04.4 \
        libudunits2-dev=2.2.26-1 \
        make=4.1-9.1ubuntu1 \
        pkg-config=0.29.1-0ubuntu2 \
        python3=3.6.7-1~18.04 \
        python3-descartes=1.1.0-1 \
        python3-fiona=1.7.10-1build1 \
        python3-geojson=2.3.0-1 \
        python3-matplotlib=2.1.1-2ubuntu3 \
        python3-pandas=0.22.0-4 \
        python3-pyproj=1.9.5.1-3build1 \
        python3-setuptools=39.0.1-2 \
        python3-shapely=1.6.4-1 \
        python3-wheel=0.30.0-0.2 \
        shapelib=1.4.1-1 \
        shapetools=1.4pl6-14 \
        texlive-extra-utils=2017.20180305-2 \
        texlive-fonts-recommended=2017.20180305-1 \
        texlive-latex-extra=2017.20180305-2 \
        texlive-pictures=2017.20180305-1 \
        texlive-science=2017.20180305-2 \
    && rm -rf /var/lib/apt/lists/*

RUN conda install -y --channel=conda-forge \
        r-base==3.6.1 \
        r-corrplot==0.84 \
        r-devtools==2.2.1 \
        r-dplyr==0.8.3 \
        r-ggally==1.4.0 \
        r-ggplot2==3.2.1 \
        r-ggrepel==0.8.1 \
        r-gridextra==2.3 \
        r-reshape2==1.4.3 \
        r-scales==1.0.0 \
        r-sf==0.7_6 \
        r-stringr==1.4.0 \
        r-testthat==2.3.0 \
        r-xtable==1.8_4 \
    && conda clean -ya

COPY postInstall /
RUN /postInstall
